home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kdesu / kdesu_pty.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-11-21  |  1.3 KB  |  72 lines

  1. /* vi: ts=8 sts=4 sw=4
  2.  *
  3.  * $Id: kdesu_pty.h 363273 2004-11-15 22:43:23Z mueller $
  4.  *
  5.  * This file is part of the KDE project, module kdesu.
  6.  * Copyright (C) 1999,2000 Geert Jansen <jansen@kde.org>
  7.  *
  8.  * This is free software; you can use this library under the GNU Library 
  9.  * General Public License, version 2. See the file "COPYING.LIB" for the 
  10.  * exact licensing terms.
  11.  */
  12.  
  13.  
  14. /**
  15.  * PTY compatibility routines. This class tries to emulate a UNIX98 PTY API
  16.  * on various platforms.
  17.  */
  18. #ifndef __PTY_h_Included__
  19. #define __PTY_h_Included__
  20.  
  21. #include <qcstring.h>
  22.  
  23. #include <kdelibs_export.h>
  24.  
  25. class KDESU_EXPORT PTY {
  26.  
  27. public:
  28.     /**
  29.      * Construct a PTY object.
  30.      */
  31.     PTY();
  32.  
  33.     /**
  34.      * Destructs the object. The PTY is closed if it is still open.
  35.      */
  36.     ~PTY();
  37.  
  38.     /**
  39.      * Allocate a pty.
  40.      * @return A filedescriptor to the master side.
  41.      */
  42.     int getpt();
  43.  
  44.     /**
  45.      * Grant access to the slave side.
  46.      * @return Zero if succesfull, < 0 otherwise.
  47.      */
  48.     int grantpt();
  49.  
  50.     /**
  51.      * Unlock the slave side.
  52.      * @return Zero if successful, < 0 otherwise.
  53.      */
  54.     int unlockpt();
  55.  
  56.     /**
  57.      * Get the slave name.
  58.      * @return The slave name.
  59.      */
  60.     QCString ptsname();
  61.     
  62. private:
  63.  
  64.     int ptyfd;
  65.     QCString ptyname, ttyname;
  66.  
  67.     class PTYPrivate;
  68.     PTYPrivate *d;
  69. };
  70.     
  71. #endif  // __PTY_h_Included__
  72.